<?php

$mysqli = new mysqli("localhost", "root", "", "rss");
if ($mysqli->connect_errno) {
	echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
}


$mysqli->real_query("SELECT * FROM sources");
$res = $mysqli->use_result();

$list = array();
while ($row = $res->fetch_assoc()) {
	array_push($list, $row);
}

$result = array("sources" => $list);

echo json_encode($result);

?>
